from common.Util import BlogDriver
from tests import BlogLoginTest
from tests import BlogListTest
from tests import BlogDetailTest
from tests import BlogEditTest

    # 测试BlogLoginTest.py
    # 创建登录类对象
    # blog_login_instance = BlogLoginTest.BlogLogin()
    # # 登录成功
    # blog_login_instance.BlogSucText()
    # #登录失败
    # blog_login_instance.BlogFailText()
    # # 退出
    # BlogDriver.driver.quit()

    # # 测试BlogListTest.py
    # # 创建登录类对象
    # blog_login_instance = BlogLoginTest.BlogLogin()
    # # 登录成功
    # blog_login_instance.BlogSucText()
    # # 创建列表页对象
    # blog_login_instance=BlogListTest.BlogList()
    # # 登录状态下测试博客列表页
    # blog_login_instance.BlogLoginListTest()
    # # 退出博客登录
    # blog_login_instance.QuitBlogLoginListText()
    # # 未登录状态下测试博客列表页
    # blog_login_instance.NotBlogLoginListTest()
    # # 退出
    # BlogDriver.driver.quit()

    # #测试BlogDetailTest.py
    # blog_login_instance = BlogLoginTest.BlogLogin()
    # blog_login_instance.BlogSucText()
    # blog_dateil_instance = BlogDetailTest.BlogDetail()
    # # 测试登录状态下的详情页
    # blog_dateil_instance.BlogLoginDetailTest()
    # # 测试登录状态下详情页删除第一篇文章
    # blog_dateil_instance.DeleteBlogLoginDetailTest()
    # # 退出登录
    # blog_list_instance = BlogListTest.BlogList()
    # # 退出博客登录
    # blog_list_instance.QuitBlogLoginListText()
    # blog_dateil_instance.NotBlogLoginDetailTest()
    # BlogDriver.driver.quit()

if __name__ == "__main__":
    blog_login_instance = BlogLoginTest.BlogLogin()
    blog_login_instance.BlogSucText()
    blog_edit_instance = BlogEditTest.BlogEdit()
    blog_edit_instance.BlogLoginEditTest()
    #然后调用退出博客函数
    blog_list_instance = BlogListTest.BlogList()
    blog_list_instance.QuitBlogLoginListText()
    # 再调用未登录状态下，去测试博客编辑页
    blog_edit_instance.NotBlogLoginEditTest()







